package com.beordie.dao;

import com.beordie.model.Driver;

import java.util.List;

/**
 * @Classname IDriverDao
 * @Description TODO
 * @Date 2021/7/13 17:16
 * @Created 30500
 */
public interface IDriverDao {
    String SQL_SELECT_ALL = "SELECT * FROM DRIVER";
    String SQL_SELECT_ALL_BY_LIMIT = "SELECT * FROM DRIVER LIMIT ? , ?";
    String SQL_INSERT_ONE = "INSERT INTO DRIVER VALUES(NULL,?,?,?,?,?,?)";
    String SQL_DELETE_BY_ID = "DELETE FROM DRIVER WHERE ID = ?";
    String SQL_UPDATE_BY_ID = "UPDATE DRIVER SET NAME = ?, ADDRESS = ?, POSTCARD = ?, PHONE = ?, CREATETIME = ?, NUMBER = ? WHERE ID = ?";
    String SQL_SELECT_BY_NUMBER = "SELECT * FROM DRIVER WHERE NUMBER = ?";
    String SQL_SELECT_COUNT = "SELECT COUNT(1) FROM DRIVER";

    public List<Driver> getAllDrivers();
    public List<Driver> getAllByLimit(boolean isLimit, int start, int size);
    public int insert(Driver driver);
    public int deleteById(int id);
    public int updateById(Driver driver, int id);
    public Driver findByNumName(String condition);
    public int getCount();
}
